<div xmlns="http://www.w3.org/1999/xhtml"
  xmlns:ui="http://java.sun.com/jsf/facelets"
  xmlns:f="http://java.sun.com/jsf/core"
  xmlns:h="http://java.sun.com/jsf/html"
  xmlns:c="http://java.sun.com/jstl/core"
  xmlns:a4j="http://richfaces.org/a4j"
  class="mainNoTabs">

  <c:if test="#{webActions.checkFilter('directoriesManagementAccess')}">
    <h:form id="selectDirectoryForm">
    <div class="bubbleBox">
      <table class="dataInput">
        <tbody>
          <tr>
            <td class="labelColumn">
              <h:outputText value="#{messages['label.vocabulary.select']}" />
            </td>
            <td class="fieldColumn">
              <h:selectOneMenu id="directoriesList" styleClass="dataInputText"
                value="#{directoryUIActions.selectedDirectoryName}">
                <c:forEach var="dirName"
                  items="#{directoryUIActions.directoryNames}">
                  <f:selectItem itemLabel="#{messages[dirName]}"
                    itemValue="#{dirName}" />
                </c:forEach>
                <f:ajax event="valueChange"
                  render="selectDirectoryForm directoryListingPanel"
                  listener="#{directoryUIActions.selectDirectory()}"
                  execute="@this">
                </f:ajax>
              </h:selectOneMenu>
            </td>
            <td class="iconColumn">
              <a4j:status id="selectDirectoryStatus">
                <f:facet name="start">
                  <h:graphicImage value="/img/standart_waiter.gif" />
                </f:facet>
              </a4j:status>
            </td>
          </tr>
        </tbody>
      </table>
    </div>
    </h:form>

    <a4j:outputPanel id="directoryListingPanel"
      rendered="#{not empty directoryUIActions.selectedDirectoryName}"
      layout="block">
      <ui:include src="view_directory.xhtml"/>
    </a4j:outputPanel>
  </c:if>

  <c:if test="#{!webActions.checkFilter('directoriesManagementAccess')}">
    Unauthorized user
  </c:if>

</div>

